package com.soup.common.module.sys.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.soup.common.constant.CommonConstant;
import com.soup.common.entity.BaseEntity;
import lombok.Data;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * 用户模型
 *
 * @author zhaoyi
 */
@Data
@Table(name = CommonConstant.SYS_USER)
public class User extends BaseEntity {

    private String loginName;

    @JSONField(serialize = false)
    private String password;

    private String nickName;

    private Integer userType;

    /**
     * 用户状态：1可用，0禁用
     */
    private Integer userStatus;

    private Integer roleId;

    /**
     * 是否删除：1已删除，0未删除
     */
    private Integer deleted;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;

    /**
     * 非表字段
     */
    @Transient
    private Role role;

}
